\doxysubsection{x\+Event\+Group\+Clear\+Bits }
\hypertarget{group__x_event_group_clear_bits}{}\label{group__x_event_group_clear_bits}\index{xEventGroupClearBits@{xEventGroupClearBits}}
\doxylink{event__groups_8h_source}{event\+\_\+groups.\+h} 
\begin{DoxyPre}
   EventBits\_t xEventGroupClearBits( EventGroupHandle\_t xEventGroup, const EventBits\_t uxBitsToClear );
\end{DoxyPre}


Clear bits within an event group. This function cannot be called from an interrupt.


\begin{DoxyParams}{Parameters}
{\em x\+Event\+Group} & The event group in which the bits are to be cleared.\\
\hline
{\em ux\+Bits\+To\+Clear} & A bitwise value that indicates the bit or bits to clear in the event group. For example, to clear bit 3 only, set ux\+Bits\+To\+Clear to 0x08. To clear bit 3 and bit 0 set ux\+Bits\+To\+Clear to 0x09.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The value of the event group before the specified bits were cleared.
\end{DoxyReturn}
Example usage\+: 
\begin{DoxyPre}
  \#define BIT\_0 ( 1 << 0 )
  \#define BIT\_4 ( 1 << 4 )

  void aFunction( EventGroupHandle\_t xEventGroup )
  \{
  EventBits\_t uxBits;

    // Clear bit 0 and bit 4 in xEventGroup.
    uxBits = xEventGroupClearBits(
                            xEventGroup,    // The event group being updated.
                            BIT\_0 | BIT\_4 );// The bits being cleared.

    if( ( uxBits \& ( BIT\_0 | BIT\_4 ) ) == ( BIT\_0 | BIT\_4 ) )
    \{
        // Both bit 0 and bit 4 were set before xEventGroupClearBits() was
        // called.  Both will now be clear (not set).
    \}
    else if( ( uxBits \& BIT\_0 ) != 0 )
    \{
        // Bit 0 was set before xEventGroupClearBits() was called.  It will
        // now be clear.
    \}
    else if( ( uxBits \& BIT\_4 ) != 0 )
    \{
        // Bit 4 was set before xEventGroupClearBits() was called.  It will
        // now be clear.
    \}
    else
    \{
        // Neither bit 0 nor bit 4 were set in the first place.
    \}
  \}
  \end{DoxyPre}
 